import jsbarcode from 'jsbarcode'

const canvas = document.createElement("canvas")

export default (value, options) => {
  try{
    jsbarcode(canvas, value, options)
  }catch(err){
    console.log(err)
    return ''
  }
  return canvas.toDataURL('base64')
}